\hypertarget{namespaceapp}{
\section{Package app}
\label{namespaceapp}\index{app@{app}}
}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class \hyperlink{classapp_1_1index}{index}
\item 
class \hyperlink{classapp_1_1save__as__vot}{save\_\-as\_\-vot}
\item 
class \hyperlink{classapp_1_1save__as__html}{save\_\-as\_\-html}
\item 
class \hyperlink{classapp_1_1viewer}{viewer}
\item 
class \hyperlink{classapp_1_1send__email}{send\_\-email}
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
def \hyperlink{namespaceapp_aa59de57554bffcc13db2cab676c26098}{generate\_\-form\_\-data}
\item 
def \hyperlink{namespaceapp_ab33cfa88b51e02948cb038d94755d225}{generate\_\-endpoint\_\-from\_\-list}
\item 
def \hyperlink{namespaceapp_a233a6c5b8b5746323fcd2faec0eefd84}{fetch\_\-metadata}
\item 
def \hyperlink{namespaceapp_a11dc75b1a11c5b18b85bc15c576e047f}{print\_\-tables\_\-for\_\-viewer}
\item 
def \hyperlink{namespaceapp_a25f03be8c6cedbe75bce33be161fb2d9}{change\_\-destruction\_\-time}
\item 
def \hyperlink{namespaceapp_a5d99473793f7658e48b354af7a8adf71}{get\_\-async\_\-results}
\item 
def \hyperlink{namespaceapp_ae1f9f76860d4364bf0e1be706f38d122}{start\_\-async\_\-loop}
\item 
def \hyperlink{namespaceapp_ad548b12907993d1b0aba8089e9dcd441}{printSaveHTMLTableInfo}
\item 
def \hyperlink{namespaceapp_a40da0371f87963ba2c1ddc6ea2f4df42}{printSaveVOTableInfo}
\item 
def \hyperlink{namespaceapp_ab3aaeab2f22399e711e84258631b9cd4}{execute\_\-async\_\-query}
\item 
def \hyperlink{namespaceapp_aff7ec71603af24d71256d4aefbe1e70a}{generate\_\-HTML\_\-from\_\-query}
\item 
def \hyperlink{namespaceapp_a056779e382e44adf4f65506ec55df571}{printTables}
\item 
def \hyperlink{namespaceapp_afb918c99d65bd40cacfacc9857f90e2f}{is\_\-test}
\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\hypertarget{namespaceapp_a44f0a0a7f346287978f731e273e034d5}{
string {\bfseries mode\_\-global} = 'async'}
\label{namespaceapp_a44f0a0a7f346287978f731e273e034d5}

\item 
\hypertarget{namespaceapp_a739946f0015cfe1b0512c18c55afbfe2}{
string {\bfseries request} = 'doQuery'}
\label{namespaceapp_a739946f0015cfe1b0512c18c55afbfe2}

\item 
\hypertarget{namespaceapp_a1c468c3307cdfac3a0c0b9451647b5bc}{
string {\bfseries format} = 'votable'}
\label{namespaceapp_a1c468c3307cdfac3a0c0b9451647b5bc}

\item 
\hypertarget{namespaceapp_a8e3b10d5bf8be96d6132cfd4752379e5}{
string {\bfseries lang} = 'ADQL'}
\label{namespaceapp_a8e3b10d5bf8be96d6132cfd4752379e5}

\item 
\hypertarget{namespaceapp_a20e76d571335c2ae81493e746b9d6123}{
string {\bfseries DR2TAPurl} = 'http://wfaudata.roe.ac.uk/ukidssWorld-\/dsa//TAP/'}
\label{namespaceapp_a20e76d571335c2ae81493e746b9d6123}

\item 
\hypertarget{namespaceapp_ab47db261d61accb4ca9b3da7fbb3581c}{
string {\bfseries tap\_\-factory} = \char`\"{}http://admire3.epcc.ed.ac.uk:8081/TAPFactory/create\char`\"{}}
\label{namespaceapp_ab47db261d61accb4ca9b3da7fbb3581c}

\item 
\hypertarget{namespaceapp_af502a6cc4eef7de60de488c3509f8300}{
tuple {\bfseries urls} = ('/', '\hyperlink{classapp_1_1index}{index}','/\hyperlink{classapp_1_1save__as__vot}{save\_\-as\_\-vot}','\hyperlink{classapp_1_1save__as__vot}{save\_\-as\_\-vot}','/\hyperlink{classapp_1_1save__as__html}{save\_\-as\_\-html}','\hyperlink{classapp_1_1save__as__html}{save\_\-as\_\-html}','/\hyperlink{classapp_1_1viewer}{viewer}','\hyperlink{classapp_1_1viewer}{viewer}','/\hyperlink{classapp_1_1send__email}{send\_\-email}','\hyperlink{classapp_1_1send__email}{send\_\-email}')}
\label{namespaceapp_af502a6cc4eef7de60de488c3509f8300}

\item 
\hypertarget{namespaceapp_a5296b2abdb32e25fbcb05aa72cc9f45f}{
tuple {\bfseries render} = web.template.render('templates/')}
\label{namespaceapp_a5296b2abdb32e25fbcb05aa72cc9f45f}

\item 
\hypertarget{namespaceapp_ad3afa162eb284cf3d0ed835917982bc9}{
tuple {\bfseries app} = web.application(urls, globals())}
\label{namespaceapp_ad3afa162eb284cf3d0ed835917982bc9}

\item 
\hypertarget{namespaceapp_ae4ac16c16822e3de4ef340af5e2f2a60}{
tuple {\bfseries my\_\-form} = web.form.Form(web.form.Textarea('textfield',web.form.notnull,row=200,cols=30, class\_\-='textfield', id='textfield',description=''),web.form.Hidden(name='tap\_\-endpoint',id='tap\_\-endpoint'))}
\label{namespaceapp_ae4ac16c16822e3de4ef340af5e2f2a60}

\item 
\hypertarget{namespaceapp_afbd1c43148d80fafe293f8a7aa59a40b}{
tuple {\bfseries tap\_\-endpoint\_\-form} = web.form.Form($\ast$generate\_\-form\_\-data('http://registry.astrogrid.org/astrogrid-\/registry/main/xqueryresults.jsp'))}
\label{namespaceapp_afbd1c43148d80fafe293f8a7aa59a40b}

\item 
\hypertarget{namespaceapp_a99bbfbf81f033a0f303cf873c37562a6}{
dictionary {\bfseries t\_\-globals} = \{'datestr': web.datestr \}}
\label{namespaceapp_a99bbfbf81f033a0f303cf873c37562a6}

\item 
\hypertarget{namespaceapp_ab0883d580eea72fcc08abca95d95e38a}{
string {\bfseries ERROR\_\-HTML} = \char`\"{}$<$div style=$\backslash$\char`\"{}color:red;margin-\/left:50px;$\backslash$\char`\"{}$>$No elements returned. Please check your query$<$/div$>$\char`\"{}}
\label{namespaceapp_ab0883d580eea72fcc08abca95d95e38a}

\item 
\hypertarget{namespaceapp_adf9e1c346382f68bdbaa9f474f072c53}{
int {\bfseries delay} = 3}
\label{namespaceapp_adf9e1c346382f68bdbaa9f474f072c53}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
\begin{DoxyVerb}
Documentation for the main webpy app module.

Created on May 17, 2011
Web py University of Edinburgh DSc Masters project
@author: Stelios Voutsinas

\end{DoxyVerb}
 

\subsection{Function Documentation}
\hypertarget{namespaceapp_a25f03be8c6cedbe75bce33be161fb2d9}{
\index{app@{app}!change\_\-destruction\_\-time@{change\_\-destruction\_\-time}}
\index{change\_\-destruction\_\-time@{change\_\-destruction\_\-time}!app@{app}}
\subsubsection[{change\_\-destruction\_\-time}]{\setlength{\rightskip}{0pt plus 5cm}def app.change\_\-destruction\_\-time ( {\em url}, \/   {\em new\_\-time})}}
\label{namespaceapp_a25f03be8c6cedbe75bce33be161fb2d9}
\begin{DoxyVerb}
Documentation for the change_destruction_time function.

Change the destruction time for a TAP job
\end{DoxyVerb}
 \hypertarget{namespaceapp_ab3aaeab2f22399e711e84258631b9cd4}{
\index{app@{app}!execute\_\-async\_\-query@{execute\_\-async\_\-query}}
\index{execute\_\-async\_\-query@{execute\_\-async\_\-query}!app@{app}}
\subsubsection[{execute\_\-async\_\-query}]{\setlength{\rightskip}{0pt plus 5cm}def app.execute\_\-async\_\-query ( {\em url}, \/   {\em mode\_\-local}, \/   {\em q})}}
\label{namespaceapp_ab3aaeab2f22399e711e84258631b9cd4}
\begin{DoxyVerb}
Documentation for the execute_async_query function.
 
Execute an ADQL query (q) against a TAP service (url + mode:sync|async)       
Starts by submitting a request for an async query, then uses the received job URL to call start_async_loop, to receive the final query results 
\end{DoxyVerb}
 \hypertarget{namespaceapp_a233a6c5b8b5746323fcd2faec0eefd84}{
\index{app@{app}!fetch\_\-metadata@{fetch\_\-metadata}}
\index{fetch\_\-metadata@{fetch\_\-metadata}!app@{app}}
\subsubsection[{fetch\_\-metadata}]{\setlength{\rightskip}{0pt plus 5cm}def app.fetch\_\-metadata ( {\em tap\_\-endpoint})}}
\label{namespaceapp_a233a6c5b8b5746323fcd2faec0eefd84}
\begin{DoxyVerb}
Documentation for the fetch_metadata function.

Takes a TAP endpoint URL, and generates the table metadata. This is done by reading and parsing the XML table information using the xml_dom.minidom library and the xml_parser module
\end{DoxyVerb}
 \hypertarget{namespaceapp_ab33cfa88b51e02948cb038d94755d225}{
\index{app@{app}!generate\_\-endpoint\_\-from\_\-list@{generate\_\-endpoint\_\-from\_\-list}}
\index{generate\_\-endpoint\_\-from\_\-list@{generate\_\-endpoint\_\-from\_\-list}!app@{app}}
\subsubsection[{generate\_\-endpoint\_\-from\_\-list}]{\setlength{\rightskip}{0pt plus 5cm}def app.generate\_\-endpoint\_\-from\_\-list ( {\em list})}}
\label{namespaceapp_ab33cfa88b51e02948cb038d94755d225}
\begin{DoxyVerb}
Documentation for the generate_endpoint_from_list function.

Takes a list of TAP endpoint URLs separated by a double space, and generates a merged TAP service from the OGSDA-DAI TAP factory(global tap_factory variable)
Returns the new URL to be used by the client
\end{DoxyVerb}
 \hypertarget{namespaceapp_aa59de57554bffcc13db2cab676c26098}{
\index{app@{app}!generate\_\-form\_\-data@{generate\_\-form\_\-data}}
\index{generate\_\-form\_\-data@{generate\_\-form\_\-data}!app@{app}}
\subsubsection[{generate\_\-form\_\-data}]{\setlength{\rightskip}{0pt plus 5cm}def app.generate\_\-form\_\-data ( {\em registry})}}
\label{namespaceapp_aa59de57554bffcc13db2cab676c26098}
\begin{DoxyVerb}
Documentation for the generate_form_data function.

Fetch array of available TAP endpoints from the input registry. Uses XQuery, and returns a tuple of web.form.Checkbox objects, to be added to the tap endpoint selection form
\end{DoxyVerb}
 \hypertarget{namespaceapp_aff7ec71603af24d71256d4aefbe1e70a}{
\index{app@{app}!generate\_\-HTML\_\-from\_\-query@{generate\_\-HTML\_\-from\_\-query}}
\index{generate\_\-HTML\_\-from\_\-query@{generate\_\-HTML\_\-from\_\-query}!app@{app}}
\subsubsection[{generate\_\-HTML\_\-from\_\-query}]{\setlength{\rightskip}{0pt plus 5cm}def app.generate\_\-HTML\_\-from\_\-query ( {\em votable}, \/   {\em jobId}, \/   {\em query}, \/   {\em tap\_\-endpoint})}}
\label{namespaceapp_aff7ec71603af24d71256d4aefbe1e70a}
\begin{DoxyVerb}
Documentation for the generate_HTML_from_query function.
     
Generates HTML content for the results from an ADQL/TAP query    
\end{DoxyVerb}
 \hypertarget{namespaceapp_a5d99473793f7658e48b354af7a8adf71}{
\index{app@{app}!get\_\-async\_\-results@{get\_\-async\_\-results}}
\index{get\_\-async\_\-results@{get\_\-async\_\-results}!app@{app}}
\subsubsection[{get\_\-async\_\-results}]{\setlength{\rightskip}{0pt plus 5cm}def app.get\_\-async\_\-results ( {\em url}, \/   {\em URI})}}
\label{namespaceapp_a5d99473793f7658e48b354af7a8adf71}
\begin{DoxyVerb}
Documentation for the get_async_results function.

Open the given url and URI and read/return the result 
\end{DoxyVerb}
 \hypertarget{namespaceapp_afb918c99d65bd40cacfacc9857f90e2f}{
\index{app@{app}!is\_\-test@{is\_\-test}}
\index{is\_\-test@{is\_\-test}!app@{app}}
\subsubsection[{is\_\-test}]{\setlength{\rightskip}{0pt plus 5cm}def app.is\_\-test ()}}
\label{namespaceapp_afb918c99d65bd40cacfacc9857f90e2f}
\begin{DoxyVerb}
is_test() function

Test whether the run is part of a test suite
\end{DoxyVerb}
 \hypertarget{namespaceapp_a11dc75b1a11c5b18b85bc15c576e047f}{
\index{app@{app}!print\_\-tables\_\-for\_\-viewer@{print\_\-tables\_\-for\_\-viewer}}
\index{print\_\-tables\_\-for\_\-viewer@{print\_\-tables\_\-for\_\-viewer}!app@{app}}
\subsubsection[{print\_\-tables\_\-for\_\-viewer}]{\setlength{\rightskip}{0pt plus 5cm}def app.print\_\-tables\_\-for\_\-viewer ( {\em votable}, \/   {\em tbl\_\-id}, \/   {\em tbl\_\-class})}}
\label{namespaceapp_a11dc75b1a11c5b18b85bc15c576e047f}
\begin{DoxyVerb}
Documentation for the print_tables_for_viewer function.

Print a votable as an HTML table for the table viewer (include ID for each entry)
\end{DoxyVerb}
 \hypertarget{namespaceapp_ad548b12907993d1b0aba8089e9dcd441}{
\index{app@{app}!printSaveHTMLTableInfo@{printSaveHTMLTableInfo}}
\index{printSaveHTMLTableInfo@{printSaveHTMLTableInfo}!app@{app}}
\subsubsection[{printSaveHTMLTableInfo}]{\setlength{\rightskip}{0pt plus 5cm}def app.printSaveHTMLTableInfo ( {\em html\_\-tbl})}}
\label{namespaceapp_ad548b12907993d1b0aba8089e9dcd441}
\begin{DoxyVerb}
Documentation for the printSaveHTMLTableInfo function.

Generates HTML content for HTML table save button
\end{DoxyVerb}
 \hypertarget{namespaceapp_a40da0371f87963ba2c1ddc6ea2f4df42}{
\index{app@{app}!printSaveVOTableInfo@{printSaveVOTableInfo}}
\index{printSaveVOTableInfo@{printSaveVOTableInfo}!app@{app}}
\subsubsection[{printSaveVOTableInfo}]{\setlength{\rightskip}{0pt plus 5cm}def app.printSaveVOTableInfo ( {\em vot})}}
\label{namespaceapp_a40da0371f87963ba2c1ddc6ea2f4df42}
\begin{DoxyVerb}
Documentation for the printSaveVOTableInfo function.
   
Generates HTML content for VOTable save button    
\end{DoxyVerb}
 \hypertarget{namespaceapp_a056779e382e44adf4f65506ec55df571}{
\index{app@{app}!printTables@{printTables}}
\index{printTables@{printTables}!app@{app}}
\subsubsection[{printTables}]{\setlength{\rightskip}{0pt plus 5cm}def app.printTables ( {\em votable}, \/   {\em tbl\_\-id}, \/   {\em tbl\_\-class})}}
\label{namespaceapp_a056779e382e44adf4f65506ec55df571}
\begin{DoxyVerb}
Documentation for the printTables function.
   
Print a votable as an HTML table
Takes a votable (using the VOTable library), a table class and id, and returns an HTML table with the according table cells
\end{DoxyVerb}
 \hypertarget{namespaceapp_ae1f9f76860d4364bf0e1be706f38d122}{
\index{app@{app}!start\_\-async\_\-loop@{start\_\-async\_\-loop}}
\index{start\_\-async\_\-loop@{start\_\-async\_\-loop}!app@{app}}
\subsubsection[{start\_\-async\_\-loop}]{\setlength{\rightskip}{0pt plus 5cm}def app.start\_\-async\_\-loop ( {\em url})}}
\label{namespaceapp_ae1f9f76860d4364bf0e1be706f38d122}
\begin{DoxyVerb}
Documentation for the start_async_loop function.

Takes a TAP url and starts a loop that checks the phase URI and returns the results when completed. The loop is repeated every [delay=3] seconds
\end{DoxyVerb}
 